# -*- coding: utf-8 -*-

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import math
from decimal import Decimal

#基础额度
basic_amount=150000
#模型评分调整系数
credit_score_Adj_coef={'A':0.7, 'B': 0.64, 'C': 0.58,'D':0.52 ,'E':0.46,'F':0.4,u'缺失值':0}
#评分评级
ratingLevel = decisionModelResult.get("ratingLevel").upper()

#额度一：当前订单合同金额 * 模型评分调整系数

#当前订单金额
EB02_OrderAmount={EB02_OrderAmount}

def null_type(data):
    if data==u'缺失值':
        return 0
    else:
        return float(data)

amount1=null_type(EB02_OrderAmount)*credit_score_Adj_coef[ratingLevel]

#额度二：综合授信余额
amount2=float(ratingRequest.get("amount"))
#最终额度

final_amount=min(amount1,amount2,1000000)
final_amount=round(final_amount/10000,0)*10000
result=final_amount